#include<iostream>
using namespace std;
int main()
{
	int n;
	while (cin >> n) {
		int arr[40050] = { 0 };
		int num;
		int l = 1;
		int t = 0;
		arr[0] = 1;
		for (int i = 2; i <= n; i++)
		{
			num = 0;
			for (int j = 0; j < l; j++) {
				t = arr[j] * i + num;
				arr[j] = t % 10;
				num = t / 10;
			}
			while (num)
			{
				arr[l++] = num % 10;
				num /= 10;
			}
		}
		for (int i = l - 1; i >= 0; i--) {
			cout << arr[i];
		}
		cout << endl;
	}
	
	return 0;
}